package com.broada.apm.service;


import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import com.broada.apm.ajax.AuthResult;
import com.broada.apm.model.User;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;

@Path("apm/authentication")
@Api(value="apm/authentication" , description = "用户登录退出的APIs")
@Produces(MediaType.APPLICATION_JSON)
public interface AuthenticationService {
	@POST
	@Path("/login")
	@Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
	@Produces(MediaType.APPLICATION_JSON)
	@ApiOperation(value = "用户登录")
	public AuthResult login(@ApiParam(value = "登录的用户信息，{account: \"admin\", password: \"admin\"}", required = true) User user);

	@PUT
	@Path("/logout")
	@Consumes(MediaType.APPLICATION_JSON)
	@Produces(MediaType.APPLICATION_JSON)
	@ApiOperation(value = "用户退出")
	public AuthResult logout(@ApiParam(value = "登录的用户的token信息", required = true) @QueryParam("token") String token);

}
